import { Component, OnInit, Input } from '@angular/core';

import { BlogService } from '../../../blog.service';

@Component({
  selector: 'app-issue-content',
  templateUrl: './issue-content.component.html',
  styleUrls: ['./issue-content.component.scss']
})
export class IssueContentComponent implements OnInit {
  @Input() issue: any;
  user: string;
  createAt: string;
  title: string;
  body: string;

  constructor(
    private blogService: BlogService
  ) { }

  ngOnInit() {
    this.user = this.issue.user.login;
    this.createAt = this.issue.created_at;
    this.title = this.issue.title;
    this.blogService.markedContent(this.issue.body)
      .subscribe(body => this.body = body);
  }

}
